package com.d3works.apps.bankpayment.service.batch;

import com.d3works.apps.bankpayment.db.BankOrder;
import com.d3works.apps.base.db.Batch;
import com.d3works.exception.D3worksException;
import java.io.IOException;
import javax.xml.bind.JAXBException;
import javax.xml.datatype.DatatypeConfigurationException;

public interface BatchBankPaymentService {

  /**
   * Check whether successfully processed payment schedule lines exists in batch.
   *
   * @param batch
   * @return
   */
  boolean paymentScheduleLineDoneListExists(Batch batch);

  /**
   * Create bank order.
   *
   * @param batch
   * @return
   * @throws D3worksException
   * @throws JAXBException
   * @throws IOException
   * @throws DatatypeConfigurationException
   */
  BankOrder createBankOrder(Batch batch)
      throws D3worksException, JAXBException, IOException, DatatypeConfigurationException;

  /**
   * Create bank order from processed payment schedule lines.
   *
   * @param batch
   * @return
   * @throws D3worksException
   * @throws JAXBException
   * @throws IOException
   * @throws DatatypeConfigurationException
   */
  BankOrder createBankOrderFromPaymentScheduleLines(Batch batch)
      throws D3worksException, JAXBException, IOException, DatatypeConfigurationException;

  /**
   * Create bank order from processed monthly payment schedule lines.
   *
   * @param batch
   * @return
   * @throws D3worksException
   * @throws JAXBException
   * @throws IOException
   * @throws DatatypeConfigurationException
   */
  BankOrder createBankOrderFromMonthlyPaymentScheduleLines(Batch batch)
      throws D3worksException, JAXBException, IOException, DatatypeConfigurationException;
}
